/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.myapp.c0910g.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author BachLe
 */
@Entity
@Table(name = "PaymentType")
@NamedQueries({
    @NamedQuery(name = "PaymentType.findAll", query = "SELECT p FROM PaymentType p"),
    @NamedQuery(name = "PaymentType.findByPaymentTypeID", query = "SELECT p FROM PaymentType p WHERE p.paymentTypeID = :paymentTypeID"),
    @NamedQuery(name = "PaymentType.findByPaymentTypeName", query = "SELECT p FROM PaymentType p WHERE p.paymentTypeName = :paymentTypeName"),
    @NamedQuery(name = "PaymentType.findByPaymentBy", query = "SELECT p FROM PaymentType p WHERE p.paymentBy = :paymentBy"),
    @NamedQuery(name = "PaymentType.findByCost", query = "SELECT p FROM PaymentType p WHERE p.cost = :cost")})
public class PaymentType implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "PaymentTypeID")
    private Integer paymentTypeID;
    @Basic(optional = false)
    @Column(name = "PaymentTypeName")
    private String paymentTypeName;
    @Column(name = "PaymentBy")
    private String paymentBy;
    @Basic(optional = false)
    @Column(name = "Cost")
    private int cost;
    @OneToMany(mappedBy = "paymentType")
    private List<UserRadioCab> userRadioCabList;

    public PaymentType() {
    }

    public PaymentType(Integer paymentTypeID) {
        this.paymentTypeID = paymentTypeID;
    }

    public PaymentType(Integer paymentTypeID, String paymentTypeName, int cost) {
        this.paymentTypeID = paymentTypeID;
        this.paymentTypeName = paymentTypeName;
        this.cost = cost;
    }

    public Integer getPaymentTypeID() {
        return paymentTypeID;
    }

    public void setPaymentTypeID(Integer paymentTypeID) {
        this.paymentTypeID = paymentTypeID;
    }

    public String getPaymentTypeName() {
        return paymentTypeName;
    }

    public void setPaymentTypeName(String paymentTypeName) {
        this.paymentTypeName = paymentTypeName;
    }

    public String getPaymentBy() {
        return paymentBy;
    }

    public void setPaymentBy(String paymentBy) {
        this.paymentBy = paymentBy;
    }

    public int getCost() {
        return cost;
    }

    public void setCost(int cost) {
        this.cost = cost;
    }

    public List<UserRadioCab> getUserRadioCabList() {
        return userRadioCabList;
    }

    public void setUserRadioCabList(List<UserRadioCab> userRadioCabList) {
        this.userRadioCabList = userRadioCabList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (paymentTypeID != null ? paymentTypeID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaymentType)) {
            return false;
        }
        PaymentType other = (PaymentType) object;
        if ((this.paymentTypeID == null && other.paymentTypeID != null) || (this.paymentTypeID != null && !this.paymentTypeID.equals(other.paymentTypeID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.myapp.c0910g.entity.PaymentType[paymentTypeID=" + paymentTypeID + "]";
    }

}
